Auto merge of #3893 - nrc:config-values, r=alexcrichton
authorbors <bors@rust-lang.org>
Mon, 3 Apr 2017 22:30:12 +0000 (22:30 +0000)
committerbors <bors@rust-lang.org>
Mon, 3 Apr 2017 22:30:12 +0000 (22:30 +0000)
commit305fa6825e0ea131bf110435f8a80ec1095b0c5f
tree01d6898727418b6b656c431c387a05d1b1d0eb64
parent4729175045b41b688ab903120860866ce7a22ba9
parent78e34144145785fc5ae3af53a8c270c62b4061ff
Auto merge of #3893 - nrc:config-values, r=alexcrichton

Allow a client to override values in a config

The use case here is that the RLS wants to set a project's `target-dir`, but can't do this using a config file (since the user might have their own, and it's a bit hacky) or via an environment variable (because there might be multiple instances of Cargo running on different directories in different threads.

ISTM that the best way to accomplish this is to allow the RLS to override values in the config before we make a workspace from it. However, since the config uses a `LazyCell` for the config values, this is not very nice (if something tries to read a config value before we set them, then there will be an error when we try to set them). However, this meets our needs and is pretty low impact, so it seems like the best solution for now. I'm open to other ideas though.